package cn.net.isir.controller.manager;

import cn.net.isir.common.ResultObject;
import cn.net.isir.entity.PrintScope;
import cn.net.isir.service2.PrintScopeService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author liuxubo
 * @filename DeviceManageController.java
 * @package cn.net.isir.controller.manager
 * @email lxb@isir.net.cn
 * @date 2018/12/26
 * @comment 硬件设备管理
 * @since 1.8
 */
@RestController
@RequestMapping("/device")
public class DeviceManageController {

    @Resource
    private PrintScopeService printScopeService;

    /**
     * 获取打印机列表
     * @param shopid 店铺id
     * @return 打印机列表
     */
    @RequestMapping(value = "/printer/listByShop/{shopid}", method = RequestMethod.GET)
    public ResultObject getPrinterList(@PathVariable String shopid) {
        PrintScope printScope = new PrintScope();
        printScope.setShopId(shopid);
        List<PrintScope> printScopes = printScopeService.selectList(printScope);
        return new ResultObject(200, "success", printScopes);
    }
}
